<?php
session_start();
require_once "../../../global.php";//$dirname."/".
require_once RootDir."/"."inc/config.php";
require_once RootDir."/"."inc/Uifunction.php";
require_once RootDir."/"."inc/Function.Libary.php";
require_once RootDir."/".$SystemConest[1]."/system/Config.php";
require_once RootDir."/".$SystemConest[1]."/UIFunction/adminClass.php";
require_once RootDir."/".$SystemConest[1]."/system/menusys/function.php";
require_once RootDir."/".$SystemConest[1]."/system/classsys/function.php";

$mydb=new YYBDB();
$TableName=$mydb->getTableName($MenuId);
CheckRule($MenuId,$mydb,$TableName,"");//检查登陆权限
?>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>修改产品</title>
<link href="../../Inc/Css.css" rel="stylesheet" type="text/css" />
</head>

<body>
<?php 

$PMID = $_REQUEST["PMID"];
if(strlen($MenuId)<1)
{
	$MenuId=-1;
}

echo CurrPosition((int)($MenuId),$mydb);

$ID=$_REQUEST["ID"];
if($ID=="") die;

$FormConfig1=GetFormConfig($mydb,$MenuId);
if(strlen($FormConfig1)<1) die;

$ArrFormConfig=explode(",",$FormConfig1);
$FieldsPaixuArr=getFieldsPaixuArr($mydb,$MenuId);
if($FieldsPaixuArr!="") $ArrFormConfig_new=getArrpaixu($ArrFormConfig,$FieldsPaixuArr,1);

$sqlrs="Select * From " .$SystemConest[7].$TableName . " Where " .$TableName . "0=" .$ID;

$rsc=$mydb->db_select_query($sqlrs);
$rs=$mydb->db_fetch_array($rsc);

//显示表单
?>
<form  id="MyForm" name="MyForm" action="Sys_Update_Save.php?MenuId=<? echo $MenuId;?>&ID=<? echo $ID;?>&PMID=<?php echo $PMID;?>&CurrPage=<?php echo $_REQUEST["CurrPage"];?>" method="post">
	
	<table width="95%" align=center>
	<Tr><Td class="TdLine"><?php echo $_REQUEST["Title"];?></Td></Tr>
	</table>
	<table width="95%" align=center cellspacing=3 class="TableLine">
	  <?php  

	 for($i=1;$i<count($ArrFormConfig_new);$i++)
	 {
		$n=$i;
		if($FieldsPaixuArr!="") $n=getxufileds($ArrFormConfig_new[$i],$ArrFormConfig);
		CreateField($ArrFormConfig[$n],$mydb,"FieldName_" .$n,$n,$rs[$n],159,737,"TdLine","InputNone",$ID);
	 }
	 ?>
	  
	</table>
    <label>
    <div align="center"><br>
      <input type="submit" name="Submit2" value=" 保存 "  onClick="return CheckForm()"  id="Submit2">
      <input type="button" name="Submit3" value=" 取消 " onClick="javascript:window.history.back();">
  </div>
    </label>
</form>

<?
 Form_check();
 CheckForm($FormConfig1);
 require_once RootDir.'/inc/Calendar.php';//加载日期控件
?>


</body>
</html>

